<!DOCTYPE html>
<html lang="zh">
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
	<title>教师后台 - 家校互动系统</title>
	<link rel="shortcut icon" href="favicon.ico" />
	<link href="__TMPL__css/alice.css" rel="stylesheet" type="text/css" />
	<link href="__TMPL__css/style.css" rel="stylesheet" type="text/css" />
	<script src="__TMPL__js/jquery.min.js"></script>
	<script src="__TMPL__js/head.js"></script>
	<!--[if lt IE 9]>
	<script src="__TMPL__js/html5.js"></script>
	<![endif]-->
    <script>
	function changetea(lesson_id,obj)
	{
		$('#teacher'+obj).empty();
		
		$("#teacher"+obj).append("<option value=''>选择教师</option>");
		$.getJSON("__URL__/loadteabylesson/class_id/{$class_id}/lesson_id/"+lesson_id,function(result){
		$.each(result, function(i, field){
		  $("#teacher"+obj).append("<option value='"+field['id']+"'>"+field['XM']+"</option>");
		});
	  });
		
	}
    function chgtoedit(obj,lesson_id)
	{
		 //url = '__URL__/loadlesaten/id/'+lesson_id;
		 //$.get(url, function(result){
		//	if (result)
		//	{
				$('#'+obj).html('<select id="subject'+obj+'" name="subject'+obj+'" class="ui-select" onChange="changetea(this.options[selectedIndex].value,'+"'"+obj+"'"+')"><option value=""> 选择科目 </option><volist name="subject" id="sl"><option value="{$sl.id}">{$sl.KCMC}</option></volist></select><br /><select id="teacher'+obj+'" name="teacher'+obj+'" class="ui-select"><option value=""> 选择教师 </option></select><input name="lesson'+obj+'" type="hidden" id="lesson'+obj+'" value="'+lesson_id+'">');
				
				
				
			//}
			//else
		//	{
		//		alert('已产生考勤的课程不得更改！');
		//	}
		 //});
		
		
		
	}
    </script>
</head> 
<body onload="iframe_height()">
<div id="bodyheight"><!-- 设定iframe框架 --> 

		<div style="width:100%">
         <a class="btn_back" href="__URL__/nav" style="width:20%">课程编排</a> <!-- 当前位置 返回按钮 -->
	</div>
    
	<!-- 内容框架开始 -->
	<div class="main padd6">
		<div class="tab_main clear">
			<a href="__URL__/lesson_man" class="cur">课程编排</a>
			<a href="__URL__/lesson_class">班级课程表</a>
			<a href="__URL__/lesson_year">年级课程表</a>
			<a href="__URL__/lesson_school">学校课程表</a>
		</div>

		<div class="realmain padd22 clear">
			<!-- 头部工具栏开始 -->
            				<form class="ui-form" name="search_content" method="post" action="__URL__/lesson_man" id="search_content">

			<div class="main-nav">
					<div class="ui-form-item">
						<label for="" class="ui-label" >班级：</label>
						{~classlist()} 
					</div>
                    
                    <div class="ui-form-item">
						&nbsp;<input type="submit" class="ui-button btn-search" value="搜索">
					</div>
			</div>
            </form>
			<!-- 头部工具栏结束 -->
	<form name="content_form" id="content_form" action="__URL__/lesson_save" method="post" class="tableform">

			<!-- 列表内容开始 -->
			<div class="content">
<if condition="$class_id neq ''">
				<table class="ui-table tdbor txtcentertable">
					<thead>
						<tr>
							<th> <input name="class_id"  id="class_id" value="{$class_id}" type="hidden"></th>
							<th>星期一</th>
							<th>星期二</th>
							<th>星期三</th>
							<th>星期四</th>
							<th>星期五</th>
							<th>星期六</th>
						</tr>
					</thead><!-- 表头可选 -->
					<tbody>
                      <volist name="amlist" id="vo">

						<tr>
							<td>{$vo.type_name}</td>
							<td >
                            <div id="kc_1_{$vo.id}">
                            <neq name="vo.id|loadclsles=$class_id,1,###" value="">
                            {$vo.id|loadclsles=$class_id,1,###}<br/>
                           
                            <else/><select id="subjectkc_1_{$vo.id}" name="subjectkc_1_{$vo.id}" class="ui-select" onChange="changetea(this.options[selectedIndex].value,'kc_1_{$vo.id}')">
						    <option value=""> 选择科目 </option>
                            <volist name="subject" id="sl">
                            <option value="{$sl.id}">{$sl.KCMC}</option>
							</volist>
                            </select><br />
						      <select id="teacherkc_1_{$vo.id}" name="teacherkc_1_{$vo.id}" class="ui-select">
						      <option value=""> 选择教师 </option>
					       
                            </select>
                            <input name="add_1_{$vo.id}"  id="add_1_{$vo.id}" value="1" type="hidden">
                            </neq>
                            
								</div>
							</td>
							<td><div id="kc_2_{$vo.id}">
                            <neq name="vo.id|loadclsles=$class_id,2,###" value="">
                            {$vo.id|loadclsles=$class_id,2,###}<br/>
                           
                            <else/><select id="subjectkc_2_{$vo.id}" name="subjectkc_2_{$vo.id}" class="ui-select" onChange="changetea(this.options[selectedIndex].value,'kc_2_{$vo.id}')">
						    <option value=""> 选择科目 </option>
                            <volist name="subject" id="sl">
                            <option value="{$sl.id}">{$sl.KCMC}</option>
							</volist>
                            </select><br />
						      <select id="teacherkc_2_{$vo.id}" name="teacherkc_2_{$vo.id}" class="ui-select" >
						      <option value=""> 选择教师 </option>
					       
                            </select>
                            <input name="add_2_{$vo.id}"  id="add_2_{$vo.id}" value="1" type="hidden">
                            </neq>
                            
								</div></td>
							<td><div id="kc_3_{$vo.id}">
                            <neq name="vo.id|loadclsles=$class_id,3,###" value="">
                            {$vo.id|loadclsles=$class_id,3,###}<br/>
                           
                            <else/><select id="subjectkc_3_{$vo.id}" name="subjectkc_3_{$vo.id}" class="ui-select" onChange="changetea(this.options[selectedIndex].value,'kc_3_{$vo.id}')">
						    <option value=""> 选择科目 </option>
                            <volist name="subject" id="sl">
                            <option value="{$sl.id}">{$sl.KCMC}</option>
							</volist>
                            </select><br />
						      <select id="teacherkc_3_{$vo.id}" name="teacherkc_3_{$vo.id}" class="ui-select">
						      <option value=""> 选择教师 </option>
					       
                            </select>
                            <input name="add_3_{$vo.id}"  id="add_3_{$vo.id}" value="1" type="hidden">
                            </neq>
                            
								</div></td>
							<td><div id="kc_4_{$vo.id}">
                            <neq name="vo.id|loadclsles=$class_id,4,###" value="">
                            {$vo.id|loadclsles=$class_id,4,###}<br/>
                           
                            <else/><select id="subjectkc_4_{$vo.id}" name="subjectkc_4_{$vo.id}" class="ui-select" onChange="changetea(this.options[selectedIndex].value,'kc_4_{$vo.id}')">
						    <option value=""> 选择科目 </option>
                           
                            </select><br />
						      <select id="teacherkc_4_{$vo.id}" name="teacherkc_4_{$vo.id}" class="ui-select">
						      <option value=""> 选择教师 </option>
					        
                            </select>
                            <input name="add_4_{$vo.id}"  id="add_4_{$vo.id}" value="1" type="hidden">
                            </neq>
                            
								</div></td>
							<td><div id="kc_5_{$vo.id}">
                            <neq name="vo.id|loadclsles=$class_id,5,###" value="">
                            {$vo.id|loadclsles=$class_id,5,###}<br/>
                           
                            <else/><select id="subjectkc_5_{$vo.id}" name="subjectkc_5_{$vo.id}" class="ui-select" onChange="changetea(this.options[selectedIndex].value,'kc_5_{$vo.id}')">
						    <option value=""> 选择科目 </option>
                           
                            </select><br />
						      <select id="teacherkc_5_{$vo.id}" name="teacherkc_5_{$vo.id}" class="ui-select">
						      <option value=""> 选择教师 </option>
					        
                            </select>
                            <input name="add_5_{$vo.id}"  id="add_5_{$vo.id}" value="1" type="hidden">
                            </neq>
                            
								</div></td>
							<td><div id="kc_6_{$vo.id}">
                            <neq name="vo.id|loadclsles=$class_id,6,###" value="">
                            {$vo.id|loadclsles=$class_id,6,###}<br/>
                           
                            <else/><select id="subjectkc_6_{$vo.id}" name="subjectkc_6_{$vo.id}" class="ui-select" onChange="changetea(this.options[selectedIndex].value,'kc_6_{$vo.id}')">
						    <option value=""> 选择科目 </option>
                            <volist name="subject" id="sl">
                            <option value="{$sl.id}">{$sl.KCMC}</option>
							</volist>
                            </select><br />
						      <select id="teacherkc_6_{$vo.id}" name="teacherkc_6_{$vo.id}" class="ui-select">
						      <option value=""> 选择教师 </option>
					      
                            </select>
                            <input name="add_6_{$vo.id}"  id="add_6_{$vo.id}" value="1" type="hidden">
                            </neq>
                            
								</div></td>
						</tr>
					</volist>
						
						<tr class="blanktr"></tr><!-- tr分割 -->
					  <volist name="pmlist" id="vo">

						<tr>
						  <td>{$vo.type_name}</td>
						  <td ><div id="kc_1_{$vo.id}">
						    <neq name="vo.id|loadclsles=$class_id,1,###" value=""> {$vo.id|loadclsles=$class_id,1,###}<br/>
						      <else/>
						      <select id="subjectkc_1_{$vo.id}" name="subjectkc_1_{$vo.id}" class="ui-select" onChange="changetea(this.options[selectedIndex].value,'kc_1_{$vo.id}')">
						        <option value=""> 选择科目 </option>
						        <volist name="subject" id="sl">
						          <option value="{$sl.id}">{$sl.KCMC}</option>
					            </volist>
					          </select><br />
						      <select id="teacherkc_1_{$vo.id}" name="teacherkc_1_{$vo.id}" class="ui-select">
						        <option value=""> 选择教师 </option>
						       
					          </select>
						      <input name="add_1_{$vo.id}"  id="add_1_{$vo.id}" value="1" type="hidden">
					        </neq>
						    </div></td>
						  <td><div id="kc_2_{$vo.id}">
						    <neq name="vo.id|loadclsles=$class_id,2,###" value=""> {$vo.id|loadclsles=$class_id,2,###}<br/>
						      <else/>
						      <select id="subjectkc_2_{$vo.id}" name="subjectkc_2_{$vo.id}" class="ui-select" onChange="changetea(this.options[selectedIndex].value,'kc_2_{$vo.id}')">
						        <option value=""> 选择科目 </option>
						        <volist name="subject" id="sl">
						          <option value="{$sl.id}">{$sl.KCMC}</option>
					            </volist>
					          </select><br />
						      <select id="teacherkc_2_{$vo.id}" name="teacherkc_2_{$vo.id}" class="ui-select">
						        <option value=""> 选择教师 </option>
						        
					          </select>
						      <input name="add_2_{$vo.id}"  id="add_2_{$vo.id}" value="1" type="hidden">
					        </neq>
						    </div></td>
						  <td><div id="kc_3_{$vo.id}">
						    <neq name="vo.id|loadclsles=$class_id,3,###" value=""> {$vo.id|loadclsles=$class_id,3,###}<br/>
						      <else/>
						      <select id="subjectkc_3_{$vo.id}" name="subjectkc_3_{$vo.id}" class="ui-select" onChange="changetea(this.options[selectedIndex].value,'kc_3_{$vo.id}')">
						        <option value=""> 选择科目 </option>
						        <volist name="subject" id="sl">
						          <option value="{$sl.id}">{$sl.KCMC}</option>
					            </volist>
					          </select><br />
						      <select id="teacherkc_3_{$vo.id}" name="teacherkc_3_{$vo.id}" class="ui-select">
						        <option value=""> 选择教师 </option>
						       
					          </select>
						      <input name="add_3_{$vo.id}"  id="add_3_{$vo.id}" value="1" type="hidden">
					        </neq>
						    </div></td>
						  <td><div id="kc_4_{$vo.id}">
						    <neq name="vo.id|loadclsles=$class_id,4,###" value=""> {$vo.id|loadclsles=$class_id,4,###}<br/>
						      <else/>
						      <select id="subjectkc_4_{$vo.id}" name="subjectkc_4_{$vo.id}" class="ui-select" onChange="changetea(this.options[selectedIndex].value,'kc_4_{$vo.id}')">
						        <option value=""> 选择科目 </option>
						        <volist name="subject" id="sl">
						          <option value="{$sl.id}">{$sl.KCMC}</option>
					            </volist>
					          </select><br />
						      <select id="teacherkc_4_{$vo.id}" name="teacherkc_4_{$vo.id}" class="ui-select">
						        <option value=""> 选择教师 </option>
						        
					          </select>
						      <input name="add_4_{$vo.id}"  id="add_4_{$vo.id}" value="1" type="hidden">
					        </neq>
						    </div></td>
						  <td><div id="kc_5_{$vo.id}">
						    <neq name="vo.id|loadclsles=$class_id,5,###" value=""> {$vo.id|loadclsles=$class_id,5,###}<br/>
						      <else/>
						      <select id="subjectkc_5_{$vo.id}" name="subjectkc_5_{$vo.id}" class="ui-select" onChange="changetea(this.options[selectedIndex].value,'kc_5_{$vo.id}')">
						        <option value=""> 选择科目 </option>
						        <volist name="subject" id="sl">
						          <option value="{$sl.id}">{$sl.KCMC}</option>
					            </volist>
					          </select><br />
						      <select id="teacherkc_5_{$vo.id}" name="teacherkc_5_{$vo.id}" class="ui-select">
						        <option value=""> 选择教师 </option>
						       
					          </select>
						      <input name="add_5_{$vo.id}"  id="add_5_{$vo.id}" value="1" type="hidden">
					        </neq>
						    </div></td>
						  <td><div id="kc_6_{$vo.id}">
						    <neq name="vo.id|loadclsles=$class_id,6,###" value=""> {$vo.id|loadclsles=$class_id,6,###}<br/>
						      <else/>
						      <select id="subjectkc_6_{$vo.id}" name="subjectkc_6_{$vo.id}" class="ui-select" onChange="changetea(this.options[selectedIndex].value,'kc_6_{$vo.id}')">
						        <option value=""> 选择科目 </option>
						        <volist name="subject" id="sl">
						          <option value="{$sl.id}">{$sl.KCMC}</option>
					            </volist>
					          </select><br />
						      <select id="teacherkc_6_{$vo.id}" name="teacherkc_6_{$vo.id}" class="ui-select">
						        <option value=""> 选择教师 </option>
						       
					          </select>
						      <input name="add_6_{$vo.id}"  id="add_6_{$vo.id}" value="1" type="hidden">
					        </neq>
						    </div></td>
					    </tr>
						</volist>
					</tbody>
				</table>           
             
			  <div class="submitdiv">
					<input type="submit" class="ui-button ui-button-mgreen" value="提交">
					<input type="button" class="ui-button ui-button-mwhite" value="返回" onclick="history.go(-1)">
				</div>
			</if>   	
			</div>
			<!-- 列表内容结束 -->
			</form>
			
		</div>
	</div>
	<!-- 内容框架结束 -->
</div>

<iframe width='0' id='top_src' height='0' src=''></iframe>
<include file="Public:foot" />
</body>
</html>